package com.neusoft.controller;

import com.neusoft.entity.Role;
import com.neusoft.entity.Student;
import com.neusoft.service.RoleComsumerService;
import com.neusoft.service.StudentComsumerService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpSession;

/**
 * @author whongf
 * @create 2020-06-08-20:14
 */
@RestController
@RequestMapping("student/feign")
public class StudentComsumerController {
    @Autowired
    private StudentComsumerService studentComsumerService;

    @PostMapping("queryAll")
    public Object queryAll(@RequestParam("page") Integer page, @RequestParam("limit") Integer limit, @RequestBody Student student){


        return studentComsumerService.queryAll(page,limit,student);
    }

    @PostMapping("save")
    public Object save(@RequestBody Student student){
        return studentComsumerService.save(student);
    }
    @PostMapping("delete")
    public Object delete(@RequestParam("ids") Integer[] ids){
        return studentComsumerService.delete(ids);
    }

    @PostMapping("upload")
    public Object imporCourse(@RequestParam("file") MultipartFile file){
        return studentComsumerService.imporCourse(file);
    }


}
